<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>组织机构树状显示</title>
<script type="text/javascript" src="/scripts/dtree.js"></script>
</head>
<body>
	<div class="dtree">

<input type="button" id="but1" value="确定" onclick="javascript:tijiao()"/>
<script type="text/javascript">
	var d = new dTree('d');
</script>
<s:iterator id="dtree" value="list">
	<script type="text/javascript">
		d.add('<s:property="">',
			      '<bean:write id="dtree" property="tree/parent_id"/>',
			      '<bean:write id="dtree" property="tree/ent_name"/>',
			      "javascript:bc('<bean:write id="dtree" property="tree/ent_id"/>','<bean:write id="dtree" property="tree/ent_name"/>');",
			      '',
			      '');
	</script>
</s:iterator>
<script type="text/javascript">
	document.write(d);
	function bc(id,name){
		document.getElementById("hid").value=id;
		document.getElementById("hidname").value=name;
	}
	function tijiao(){
		var id=document.getElementById("hid").value;
		var name=document.getElementById("hidname").value;
		window.returnValue=id+"|"+name;
		window.close();
	}
</script>

</div>
</body>
</html>